/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lily
 * Date: 2024-09-22
 * Time: 16:31
 */
public class single_Number {
    public int singleNumber(int[] nums) {
        int ret = 0;
        for (int i = 0; i < 32; i++) {
            int n = 0;
            for (int x : nums) {
                int m = (x >> i) & 1;
                n += m;
            }
            int tmp = n % 3;
            ret |= (tmp << i);
        }
        return ret;
    }

}
